#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
    string a[10]={"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; 
    void conbinStr(string digits,int level,string combine,vector<string>&v)
    {
        if(level==digits.size())
        {
            v.push_back(combine);
            return ;
        }
        int num=digits[level]-'0';
        string str=a[num];

        for(int i=0;i<str.size();i++)
        {
            conbinStr(digits,level+1,combine+str[i],v);
        }
    }
    vector<string> letterCombinations(string digits) {
        vector<string>ans;
        if(digits.size()==0)
        {
            return ans;
        }
        conbinStr(digits,0,"",ans);
        return ans;
    }
};
